package org.study.javafx.study01.config;

import cn.hutool.setting.Setting;
import lombok.experimental.UtilityClass;

/**
 * 应用配置
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2024年08月18日
 */
@UtilityClass
public class AppConfig {
    // 应用标题
    public String title = "JavaFx Application";
    // 应用图标
    public String icon = "";
    // 窗口宽度
    public int stageWidth = 640;
    // 窗口高度
    public int stageHeight = 480;
    // 允许调整窗口尺寸
    public boolean stageResizable = true;

    public void init() {
        Setting setting = new Setting("app.properties");
        title = setting.get("title");
        icon = setting.get("icon");
        stageWidth = setting.getInt("stage.width");
        stageHeight = setting.getInt("stage.height");
        stageResizable = setting.getBool("stage.resizable");
    }
}
